package com.asjy.controller;

import java.util.*;

/**
 * @Auther: lilinlin
 * @Date: 2021/4/15
 * @Description: com.asjy.controller
 * @version: 1.0
 */
public class Demo {
    public static void main(String[] args) {
        //TreeSet LinkedHashMap ConcurrentHashMap
        Map<String,String> map = new LinkedHashMap<>();
        map.put("apple","aaa");
        map.put("banna","bb");
        map.put("creay","cc");
        map.put("drop","ddf");

        Set<String> keys = map.keySet();
        for (String key : keys) {
            System.out.println(key+":"+map.get(key));
        }

        System.out.println("===============================");
        Collection<String> values = map.values();

        for (String value : values) {
            System.out.println(value);
        }


        System.out.println("====================================");

        Set<Map.Entry<String, String>> entries = map.entrySet();
        for (Map.Entry<String, String> entry : entries) {
            System.out.println(entry.getKey()+":"+entry.getValue());

        }

    }
}